import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";

const { createConfirm } = useMessage();

enum Api {
  list = '/baseinfo/acDevTask/list',
  save='/baseinfo/acDevTask/add',
  edit='/baseinfo/acDevTask/edit',
  restart='/baseinfo/acDevTask/restart'
}

/**
 * 列表接口
 * @param params
 */
export const list = (params) =>
  defHttp.get({url: Api.list, params});

/**
 * 保存或者更新
 * @param params
 */
export const saveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.edit : Api.save;
  return defHttp.post({url: url, params});
}

export const edit = (params,) => {
  return defHttp.post({url: Api.edit, params});
}

export const restart = (params,) => {
  return defHttp.post({url: Api.restart, params});
}
